package com.jasony.tools.excel;

import org.apache.poi.ss.usermodel.CellStyle;

import java.lang.reflect.Method;

public class ExcelColumnAttr {
    private String title;
    private String dataAttributes;
    private Integer priority;
    private Method method;
    private Class dataType;
    private String defaultValue;
    private CellStyle cellStyle;

    public ExcelColumnAttr(Method method) {
        this.title = method.getName().replace("get", "").replace("set", "");
        this.method = method;
        this.dataAttributes = method.getName();
        this.priority = 0;
        this.dataType = method.getReturnType();
        this.defaultValue="";
    }

    public ExcelColumnAttr(String title, String dataAttributes, Integer priority, Method method) {
        this(method);
        this.title = title;
        this.dataAttributes = dataAttributes;
        this.priority = priority;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDataAttributes() {
        return dataAttributes;
    }

    public void setDataAttributes(String dataAttributes) {
        this.dataAttributes = dataAttributes;
    }

    public Integer getPriority() {
        return priority;
    }

    public void setPriority(Integer priority) {
        this.priority = priority;
    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public Class getDataType() {
        return dataType;
    }

    public void setDataType(Class dataType) {
        this.dataType = dataType;
    }

    public String getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }

    public CellStyle getCellStyle() {
        return cellStyle;
    }

    public void setCellStyle(CellStyle cellStyle) {
        this.cellStyle = cellStyle;
    }
}
